package com.yq.cns.net

import ApiException
import com.google.gson.annotations.SerializedName
/**
*@time 2022/11/16 9:54
*@author yangqing
*@describe
*/
data class ApiResult<T>(
    @SerializedName("code")val code: Int,
    val data: T?,
    @SerializedName("msg")val msg: String,
    val timeStamp:Long,
) {
    fun fullData(): T {
        if (code == 0 && data != null) {
            return data
        } else {
            throw ApiException(code, msg)
        }
    }
}
